﻿using Mysoft.QuickCode.DbExpressionExtensions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Mysoft.QuickCode.Common
{
    /// <summary>
    /// 排序条件
    /// </summary>
    public class OrderBy
    {
        /// <summary>
        /// 排序字段名称集合
        /// </summary>
        public string[] Fields { set; get; }

        /// <summary>
        /// 排序类型
        /// </summary>
        public OrderByType OrderType { set; get; }

        /// <summary>
        /// 重写了ToString，转换为排序语句。
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            return string.Join(",", Fields) + " " + OrderType.ToString();
        }
    }
}
